<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
     <meta content="telephone=no" name="format-detection" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable = no"/>
    <title>米品-{$webseting.web_title}</title>
    <link href="__PUBLIC__/wap/css/rest.css"  rel="stylesheet">
    <link href="__PUBLIC__/wap/css/mbusiness.css"  rel="stylesheet">
</head>
<body>
    <header id="header" class="u-header clearfix">
        <div class="u-hd-left f-left">
            <a href="javascript:history.go(-1);" class="J_backToPrev"><span class="u-icon-px i-hd-back"></span></a>
        </div>
        <div class="u-hd-tit"><span>米品</span></div>
        <div class="u-hd-right f-right"><a href="{:U('wap/index/category',array('type'=>'shop_group'))}" mars_sead="nav_home_btn"><span class="u-icon-m i-hd-home"></span></a></div>
    </header>
    <section class="mlist_nav g-box">
        <span ><a href="{:U('wap/shop/index')}">米铺</a></span>
        <span class="cur"><a href="javascript:void(0);">米品</a></span>
    </section>
    <div class="filter">
        <ul>
            <li id="listCategory" class="all_chk"><span>全部</span></li>
            <li id="listBrand"><a href="{:U('wap/index/category',array('type'=>'shop_group'))}"><span>分类{$typename}</span></a></li>
            <li class="zhekou" data="0"><span>价格</span></li>
        </ul>
    </div>

    <div class="" style="margin: 10px 0;">
        <ul class="i_ul rel more_html">

            <volist name="list" id="vo">
            <li class="i_li left">
                <a href="{:U('wap/group/goods_detail',array('id'=>$vo['id']))}">
                    <div class="i_li_img_div wrap">
                        <div class="i_li_img_div_inner">
                                <span class="sellerOut">
                                    <img src="{:U('wap/index/get_thumbs',array('auto'=>240))}?img={$vo.goods_image}">
                                </span>
                        </div>
                    </div>
                    <p class="i_txt">{$vo.goods_name}</p>
                    <p class="i_pri_wrap">
                        <span class="i_pri">¥{$vo.goods_price}</span>
                    </p>
                </a>
            </li>
          </volist>  
        </ul>
    </div>

    <div class="b_q">
        <div class="fm-footer-copyright get_more">
            <if condition="$count gt 10 && count($list) eq 10">
                  加载更多
              <else/>  
                 无更多数据
            </if>
        </div>
    </div>
     <input type="hidden" name="p" value="2" />
     <input type="hidden" name="type" value="{$_GET['type']}" />
     <input type="hidden" name="order" value="" />
    <!--end 版权-->
    <div class="bottom-to-top" style="display: block; transform-origin: 0px 0px 0px; opacity: 1; transform: scale(1, 1);">
        <img src="__PUBLIC__/wap/img/scroll-to-top-icon.png" style="width: 100%;">
    </div>
    <!--end top-->
   <include file="Public/footer" />
    <!--end 页脚-->
<script src="__PUBLIC__/bootstrap/vendor/jquery/jquery.min.js"></script>
 <script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
   $(function(){
     $(".get_more").click(function(){
        get_more();
     });
     $(".all_chk").click(function(){
        $("input[name='p']").val(1);
        $("input[name='type']").val("");
        get_more();
     });
     $(".zhekou").click(function(){
        var data=$(this).attr('data');
        var zk="";
        if(data==1){
            $(this).attr('data','2')
            zk="prices2";
        }else{
          $(this).attr('data','1')
           zk="prices1";
        }
        $("input[name='p']").val(1);
        $("input[name='order']").val(zk);
        get_more();
     });
 
   }); 
   function get_more(){
     var p=$("input[name='p']").val();
     var type=$("input[name='type']").val();
     var order=$("input[name='order']").val();
           $.ajax({ 
            url: "{:U('wap/shop/shop_group')}",
            type:'get',
            data: {p:p,type:type,order:order},
            dataType: 'json',
            success: function(data){
              //console.log(data);
               var con=1;
              var option='';
              if(data){
                 $.each(data, function(i, value) {
                //this指向当前元素
                //i表示Array当前下标
                //value表示Array当前元素
                 option=option+' <li class="i_li left">'
                +'<a href="<?php echo U('wap/group/goods_detail'); ?>?id='+value.id+'">'
                +'    <div class="i_li_img_div wrap">'
                 +'       <div class="i_li_img_div_inner">'
                +'                <span class="sellerOut">'
                +'                    <img src="<?php echo U('wap/index/get_thumbs',array('auto'=>240)); ?>?img='+value.goods_image+'">'
                +'                </span>'
                +'        </div>'
                +'    </div>'
                +'    <p class="i_txt">'+value.goods_name+'</p>'
                +'    <p class="i_pri_wrap">'
                +'        <span class="i_pri">¥'+value.goods_price+'</span>'
                +'    </p>'
               +' </a>'
               +' </li>';
                    con++;
                 });
                }
                if(p==1){
                $('.more_html').html(option);
                }else{
                $('.more_html').append(option);
                }
                $("input[name='p']").val(parseInt(p)+1);

                  if(con<10){
                     $('.get_more').html('无更多数据');
                  }
            }
           });
   }
</script>
</body>
</html>